<table class="list">
<tr>
	
	<?php 
	
	foreach ($fields as $field){?>
	
		<th><?php echo $field; ?></th>
	<?php }  ?>
</tr>

<?php 


$i = 0;
foreach ($rows as $row)
{	
	
	if($i++%2){ echo "<tr>"; }else{ echo '<tr class="even" >'; }
	foreach($fields as $field)
	{
		
		echo '<td class="tl '.$field.'" >'.$row[$field]."</td>";
	}
	echo "</tr>";
}

?>

</table>
<br/>
Amount: <?php echo $i; ?> Row
<br/>